package com.liao.rent.scheduled;

import com.liao.rent.service.HouseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author: ljt
 * @Description: 订单定时任务
 * @DateTime: 2024/12/11 上午9:51
 **/



@Component
public class orderScheduled {

    @Autowired
    HouseOrderService service;

    @Scheduled(cron="0 0 1 * * ?")   //每天一点执行一次
    public void execute() {
        System.out.println("更新订单状态中...");
        service.updateOrderStatusScheduled();
    }

}
